<template>
  <el-container direction="vertical">
    <div class="backpic2">
      <el-image :src="require('@/assets/noticepic.jpg')" alt="sorry" lazy="true"></el-image>
    </div>
    <div style="margin-top: 200px">
      <el-row style="background-color: white; margin-left: 100px; margin-right: 100px" class="title">
        <el-col :span="3" :offset="0.5" style="height: 100px">
          <div style="font-size: 20px; margin-top: 20px; margin-left: -13px">企业信息
          </div>
          <div style="font-size: 15px; color: #909399; margin-top: 8px; margin-left: 13px">Company Profile</div>
        </el-col>
      </el-row>
    </div>

    <el-container>
      <div style="margin-top: 10px;">
        <el-row type="flex" class="row-bg" justify="start" align="top">
          <el-col :span="2" ><div class="compic">
            <el-image :src="logo" alt="sorry"></el-image>
          </div></el-col>
          <el-col :span="18">
            <span class="comword">
            <div style="font-size: 20px; font-weight: bold">{{ename}}</div>
            <div style="margin-top: 15px">{{entlocation}} | {{scale}} | {{etype}}</div>
              <div v-for="hii in showjob" style="margin-top: 30px">
               <p>{{hii[0][3]}}</p>
               <p style="color: red">{{hii[1][3]}}</p>
              </div>
<!--              <div v-for="(item,index) in jid" v-if="index%2==0">-->
<!--                <div>-->
<!--                  <p>{{jid[index][0]}}</p>-->
<!--                  <p style="color: red">{{jid[index][3]}}</p>-->
<!--                </div>-->
<!--                <div>-->
<!--                  <p style="font-weight: bold">{{jid[index+1][0]}}</p>-->
<!--                  <p style="font-weight: bold;color: red">{{jid[index][3]}}</p>-->
<!--                </div>-->
<!--              </div>-->
            </span>
          </el-col>
          <el-col :span="4">
            <el-button type="primary" size="small" style="margin-top:40%; margin-right: 30%;">收藏企业</el-button>
          </el-col>
        </el-row>
      </div>

      <div style="margin-top: 180px">
        <el-row class="comintro">
        <span class="intro">
          <div style="font-size: 20px; font-weight: bold">企业介绍</div>
          <div v-for="item in intro">
                  <p style="margin-top: 8px; margin-bottom: 8px; font-size: 14px">{{item}}</p>
          </div>
        </span>
        </el-row>
      </div>

      <div style="margin-top: 350px">
        <el-row class="posintro">
            <div style="font-size: 20px; font-weight: bold">在招职位</div>
        </el-row>
      </div>
      <div style="margin-top: 390px">
        <el-row type="flex" class="pos-row" justify="start" align="top">
          <el-col span="12" class="pos-col" style="margin-right: 80px;">
            <div style="text-align: left;margin-top: 5%;margin-left: 8%;">
              <div id="div1">
                <div style="font-size: 15px;font-weight: bold;width: 150%;">数据分析实习生</div>
                <div style="font-size: 12px; color: #909399;margin-top: 5%;width: 150%;">成都|5天/周|3个月</div>
              </div>
              <div style="margin-left: 65%; text-align: left">
                <div style="font-size: 15px; color: orange">150-150/天</div>
                <div style="font-size: 12px; color: #909399; margin-top: 5%;">2020-06-06</div>
              </div>
            </div>
          </el-col>
          <el-col span="12" class="pos-col" style="margin-right: 80px;">
            <div style="text-align: left;margin-top: 5%;margin-left: 8%;">
              <div id="div1">
                <div style="font-size: 15px;font-weight: bold;width: 150%;">UI设计师</div>
                <div style="font-size: 12px; color: #909399;margin-top: 5%;width: 150%;">成都|5天/周|3个月</div>
              </div>
              <div style="margin-left: 65%; text-align: left">
                <div style="font-size: 15px; color: orange">150-150/天</div>
                <div style="font-size: 12px; color: #909399; margin-top: 5%;">2020-06-06</div>
              </div>
            </div>
          </el-col>
        </el-row>
      </div>

      <div style="margin-top: 490px">
        <el-row type="flex" class="pos-row" justify="start" align="top">
          <el-col span="12" class="pos-col" style="margin-right: 80px;">
            <div style="text-align: left;margin-top: 5%;margin-left: 8%;">
              <div id="div1">
                <div style="font-size: 15px;font-weight: bold;width: 150%;">产品助理实习生</div>
                <div style="font-size: 12px; color: #909399;margin-top: 5%;width: 150%;">成都|5天/周|3个月</div>
              </div>
              <div style="margin-left: 65%; text-align: left">
                <div style="font-size: 15px; color: orange">100-150/天</div>
                <div style="font-size: 12px; color: #909399; margin-top: 5%;">2020-06-07</div>
              </div>
            </div>
          </el-col>
          <el-col span="12" class="pos-col" style="margin-right: 80px;">
            <div style="text-align: left;margin-top: 5%;margin-left: 8%;">
              <div id="div1">
                <div style="font-size: 15px;font-weight: bold;width: 150%;">新媒体运营</div>
                <div style="font-size: 12px; color: #909399;margin-top: 5%;width: 150%;">成都|3天/周|2个月</div>
              </div>
              <div style="margin-left: 65%; text-align: left">
                <div style="font-size: 15px; color: orange">100-120/天</div>
                <div style="font-size: 12px; color: #909399; margin-top: 5%;">2020-06-08</div>
              </div>
            </div>
          </el-col>
        </el-row>
      </div>

    </el-container>
  </el-container>
</template>


<script>
  import fetch from "../api/fetch";

  export default {
    name: 'companyProfile',
    data() {
      return {
        //职位信息：
        jid: [],
        showjob: [],
        jobname: '',
        jobtype: '',
        pubtime: '',
        salary: '',
        location: '',
        status: '',
        sflag: 'false',
        n: '',

        //企业详细信息：
        eid: this.$route.params.eid,
        ename: "",
        logo: "",
        etype: '',
        scale: '',
        entlocation: "",
        contact: "",
        intro: []
      }
    },
    mounted() {
      this.getComDe(this.eid)
      // this.getJobDescription(100901)
    },
    methods: {
      getJobDe(jid) {
        var j = 0
        var ejid = 0
        var jobde = []
        for (;j<jid.length;j++)
        {
          ejid = jid[j]
          fetch.getJobDetail(ejid).then(res => {
            console.log(res)
            if(res.data.status==0)
            {
            if(res.data.type==1){this.jobtype = '实习'};
            if(res.data.type==2){this.jobtype = '校招'};
            if(res.data.type==3){this.jobtype = '社招'};
            if(res.data.type==4){this.jobtype = '不限类型'};
            var jobd = [res.data.name, res.data.salary, res.data.location, this.jobtype, res.data.time]

            // jobde.push(jobd)

            }
          })
        }
        for(var l2=1;l2<=jobde.length;l2++)
        {
          if(l2%2==0)
          {
            var highitem = [jobde[l2-2], jobde[l2-1]];
            this.showjob.push(highitem)
          }
        }

      },
      getComDe(eid) {
        fetch.getCompanyDetail(eid).then(res => {
          console.log(res)
          this.ename = res.data.ename;
          this.logo = res.data.logo;
          this.entlocation = res.data.location;
          this.contac = res.data.contac;
          if(res.data.type==0){this.etype = '其他'};
          if(res.data.type==8){this.etype = '其他'};
          if(res.data.type==1){this.etype = '互联网'};
          if(res.data.type==2){this.etype = '金融'};
          if(res.data.type==3){this.etype = '快消'};
          if(res.data.type==4){this.etype = '传媒'};
          if(res.data.type==5){this.etype = '餐饮'};
          if(res.data.type==6){this.etype = '教育'};
          if(res.data.type==7){this.etype = '化工'};
          if(res.data.scale==0){this.scale = '小于150人'};
          if(res.data.scale==1){this.scale = '150至500人'};
          if(res.data.scale==2){this.scale = '500至2000人'};
          if(res.data.scale==3){this.scale = '2000人以上'};

          this.intro = res.data.intro.split(";")
          // var i = 0
          // for (; i<10; i++)
          // {
          //   this.jid.push(this.eid + '0' + i.toString())
          // }

          // this.getJobDe(this.jid)
        })
      },
      // gotoJobDe(){
      //   this.$router.push({name: 'jobDescription', params: {jid: }})
      // }
    }
  }
</script>

<style>
  p{margin-top: 8px; margin-bottom: 8px}
  #div1{float: left}

  .backpic2 {
    width: 100%;
    height: 100%;
    background-size: cover;
    position: absolute;
    z-index: -1;
    background-repeat: no-repeat;

  }

  .title{
    border-bottom-style: solid;
    border-color: rgb(238, 241, 246);
    border-width: 2px;
  }

  .row-bg {
    background: white;
    position: absolute;
    width:75%;
    height: 150px;
    margin-left: 10%;
    margin-right: 15%;
  }

  .compic {
    height: 100px;
    width: 100px;
    margin-top:30%;
    margin-left: 30%;
    background-color: white;
  }

  .comintro {
    position: absolute;
    height: 150px;
    width: 75%;
    margin-left: 10%;

  }

  .comword {
    margin-top: 3%;
    display:inline-block;
    width:80%;
    text-align:left;

  }

  .intro {
    display:inline-block;
    text-align:left;
  }

  .posintro {
    position: absolute;
    height: 150px;
    width: 75%;
    text-align:left;
    margin-left: 10%;
  }

  .pos-row {
    position: absolute;
    width:75%;
    height: 150px;
    margin-left: 10%;
  }

  .pos-col {
    height: 80px;
    background-color: white;
  }
</style>



<style scoped>

</style>
